<template>
    <div>
        <span class="iconfont iconStar" v-for="(item,index) in starArr"
              :key="index"
              :style="{color:item==1?'orange':'gray'}">
        </span>
    </div>
</template>

<script>
export default {
  name: "star",
  props: {
    count:{
      type:Number,
      default:()=> 0
    }
  },
  computed:{
    starArr(){
      let arr = new Array();
      for (let i = 1; i <= 5; i++) {
        if (this.count >= i){
          arr.push(1);
        }else {
          arr.push(0);
        }
      }
      return arr;
    }
  }
}
</script>

<style scoped lang="scss">

</style>